<?php
	include_once('general_include.php');
	$date		= date('Y-m-d H:i:s');
	
	 $user_id_to=$_REQUEST['user_id_to'];
	 $user_id_from=$_SESSION['user_id'];
	 $reply_of_msg=$_REQUEST['reply_of_msg'];
	 $message_text=$_REQUEST['message_text'];
		
	if($_REQUEST['flag']==1)
		{			
			/* Insert Into Comment Starts */
						
			$table_name = TABLEPREFIX."_message ";

			$fields_values = array( 
									'user_id_to'  			=> $user_id_to,
									'user_id_from'  		=> $user_id_from,										
									'reply_of_msg'  		=> $reply_of_msg,
									'message_text'  		=> $message_text,
									'date_added'  			=> $date
							    	);		
			
			$msgreport= $UserManagerObjAjax->InsertRecords($table_name,$fields_values);
			
			$message_id=mysql_insert_id();			

			/* Insert Into Comment Ends */
			
			echo $message_id;
			
		}
		
		
	//$smarty->display("reply_coach_dtl.tpl");
			
?>